<?php
session_start();


//define('__SITE_ROOT','/var/www/vhosts/puperchang.myec.tw/httpdocs/greenphoenix/talk');
define('__SITE_ROOT','C:/AppServ/www/luxmotor');
include(__SITE_ROOT . "/include/public_functions.php");  


//=========smarty==================================================
//定義 Smarty 所在路徑！
include(__SITE_ROOT . "/include/smarty/Smarty.class.php");  

//宣告 Smarty 物件
 $tpl = new Smarty();


//以下六行分別定義「放置模版檔案的目錄」、「編譯出的結果放置目錄」、「設定檔放置目錄」、「快取檔案放置目錄」及「符號」(左、右)
 $tpl->template_dir = __SITE_ROOT . "/templates/";
 $tpl->compile_dir = __SITE_ROOT . "/templates_c/";
 $tpl->cache_dir = __SITE_ROOT . "/cache/";
 $tpl->left_delimiter = '<{';
 $tpl->right_delimiter = '}>';


//=======adodb==========================================
include(__SITE_ROOT . '/include/adodb/adodb.inc.php');
$DB_mch="localhost";
$DB_user="a";
$DB_pwd="a";
$DB_database="luxmotor";
$conn = &ADONewConnection('mysql');
//$conn->debug=true;
// 格式：$conn->Connect('主機', '使用者', '密碼', '資料庫');
$conn->PConnect($DB_mch, $DB_user, $DB_pwd, $DB_database);
$conn->EXECUTE("set names 'utf8'"); 

//=======其他==========================================
//關鍵字
$keyword = get_singlecontent($conn, "keyword");
$tpl->assign("keyword",$keyword);

//最新消息列表
$sql = "SELECT id,title,publicTime FROM `news` ORDER BY `news`.`publicTime` DESC LIMIT 0 , 5";
$rs = &$conn->Execute($sql);
$news_title_List = $rs->getArray();
$tpl->assign("news_List",$news_title_List);


/*
include\ckfinder\config.php
baseUrl
baseDir
也要修改

*/
?>